package com.njdf.service.serviceImpl;

import com.njdf.dao.UserDao;
import com.njdf.dao.daoImpl.UserDaoImpl;
import com.njdf.entity.People;
import com.njdf.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao l=new UserDaoImpl();
    UserDaoImpl ll=new UserDaoImpl();
    @Override
    public People queryByName(String name) {
        return l.queryByName(name);
    }

    @Override
    public List<People> queryAll() {
        return l.queryAll();
    }

    @Override
    public Boolean insert(People people) {
//        System.out.println(ll.isExit(people.getName()));
        if((ll.isExit(people.getName()))){
            return l.insert(people);
        }else {
            return false;
        }
    }

    @Override
    public Boolean delete(String name) {
        return l.delete(name);
    }

    @Override
    public Boolean update(People people) {
        return l.update(people);
    }
}
